<template>
  <scroll id="left">
    <div class="left-list">
      <div class="left-item" @click="leftClick(index)" :class="{active: index==currentIndex}" v-for="(item,index) in cateLeft" :key="index">
        {{item.title}}
      </div>
    </div>
  </scroll>
</template>

<script>
  import scroll from "components/common/scroll/scroll.vue"
  export default {
    props: {
      cateLeft: {
        type: Array,
        default(){
          return []
        }
      },
      currentIndex:{
        type:Number,
        default:0
      }
    },
    data(){
      return{

      }
    },
    methods: {
      leftClick(index) {
        this.$emit('leftClick', index)
      }
    },
    components: {
      scroll
    },

  }
</script>

<style scoped>
  .left-item{
    height: 45px;
    line-height: 45px;
    width: 100%;
    text-align: center;
    font-size: 14px;
    box-sizing: border-box;
  }
  .active{
    background-color: #fff;
    color: var(--color-high-text);
    font-weight: bold;
    border-left: 3px solid var(--color-high-text);
  }
</style>
